<?php
/**
 * 基础Modal类
 * Users: Siam
 * Date: 2019/12/18 0018
 * Time: 19:58
 */

namespace App\Model;

class BaseModel extends \EasySwoole\ORM\AbstractModel
{
    protected $pre = 'siam_';

    public function __construct(array $data = [])
    {
        $this->tableName = $this->pre . $this->tableName;
        parent::__construct($data);
    }

    public function tableName(?string $name = null, bool $is_temp = false)
    {
        if ($name !== null) $name = $this->pre.$name;
        return parent::tableName($name, $is_temp); // TODO: Change the autogenerated stub
    }
}